using System.Drawing;
using Tiwo.Design.Renderers;
using Tiwo.Elements;

namespace Tiwo.Design.ItemRenderers
{
    public class InputRenderer : RectangularRenderer
    {
        public InputFlowPoint Point { get; private set; }

        public InputRenderer(InputFlowPoint point)
        {
            Point = point;
            Size = new SizeF(100, 20);
        }

        public override void DrawTo(Graphics graphics, IRenderingCache rendering)
        {
            graphics.FillRectangle(Brushes.WhiteSmoke, Location.X, Location.Y, Size.Width, Size.Height);
            graphics.DrawRectangle(Pens.Black, Location.X, Location.Y, Size.Width, Size.Height);

            graphics.DrawString(Point.FriendlyName, rendering.Font, Brushes.Black, Location);
        }
    }
}